<template>
  <div id="ordernumber">  

    <el-form ref="form"  label-width="80px">           
          <el-row>
            <el-col :span="12" >  
                <el-page-header @back="goBack"   :content='"查询明细"'  style="margin-bottom:10px;"></el-page-header>
            </el-col>
          </el-row>

    </el-form>

   <!-- 渲染数据list -->
   <ordernumber-list :datalist="datalist"> </ordernumber-list>
   
     
     <div style="margin-top:10px;text-align: center;">
      <el-pagination
        background
        @current-change="handleCurrentChange"
        :page-size="10"  
        layout="prev, pager, next, jumper"
        :total="count">
      </el-pagination>
    </div>
      
  </div>
</template>

<script>
import OrdernumberList from '@/view/Order/OrdernumberList'
export default {
  name: 'ordernumber',
  data () {
    return {
      datalist:[],
      page:1,
      count:0,
      form:{
          time:'',
          phone:'',
          bh:'',
          select_num:'',
          select_num_zy:'',
          select_num_mode:0
        },
    }
  },
 components:{
    OrdernumberList
  },
  created(){
      this.form.bh = this.$route.query.pid
     this.list_fun()
  }, 
  mounted (){
    
  },
  methods: {
     list_fun(){
          this.post("/trade_goods/listOfData", {
              page:this.page,
              pid:this.form.bh,
              onetime:this.form.time,
              telphone:this.form.phone,
              type:this.form.select_num,
              maid:this.form.select_num_zy,
              buyOrSale:this.form.select_num_mode,
              search_all:0 //0 分页 1 全部
	        }).then(res => {
            this.count = res.result.count
            this.datalist = res.result.list

              for(let item of this.datalist) {

                 item.voucher_linkList = [this.urlimg + item.voucher_link]  //首次上传凭证图片
                item.again_voucher_linkList = [this.urlimg + item.again_voucher_link]  //重新上传凭证图片
                 item.reason_picturelist =  [this.urlimg + item.reason_picture]  //驳回图片

                item.appeal_picturelist =  [this.urlimg + item.appeal_picture]  //申述图片
              }

            //console.log(res)
         })
      },
    goBack() {
        this.$router.go(-1)
    },
     handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
        this.page = val
         this.list_fun()
        console.log(`当前页: ${val}`);
      }
  }
}
</script>


<style scoped>


</style>
